package com.learn.image.enums;

/**
 * web相关接口返回状态枚举
 *
 * @author: Administrator
 * @createTime: 2023/11/28 0028 17:22
 * @updateUser: Administrator
 * @updateTime: 2023/11/28 0028 17:22
 * @updateRemark: 修改内容
 * @version: v1.0
 */
public enum ReturnCodeAndMsgEnum implements BaseCodeEnum, BaseDescribedEnum {
    /**
     *
     */
    SUCCESS(0, "ok"),
    /**
     *
     */
    NO_DATA(-1, "no data"),
    /**
     *
     */
    SYSTEM_ERROR(10004, "system error");

    private final Integer code;

    private final String name;

    ReturnCodeAndMsgEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static ReturnCodeAndMsgEnum getByCode(int code) {
        ReturnCodeAndMsgEnum[] var1 = values();

        for (ReturnCodeAndMsgEnum aiTypeEnum : var1) {
            if (aiTypeEnum.code == code) {
                return aiTypeEnum;
            }
        }

        return SUCCESS;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }


}
